package com.li.tms.upms.controller;

import com.google.common.collect.Lists;
import com.li.tms.common.R;
import com.li.tms.upms.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/upms/user")
public class UserController {

    @GetMapping
    public R<List<User>> list() {
        List<User> users = Lists.newArrayList();
        User user;
        for (int i = 0; i < 5; i++) {
            user = new User();
            user.setId(Long.valueOf(i));
            user.setUsername("姓名：" + i);
            user.setPassword("密码：" + i);
            users.add(user);
        }
        return R.success(200,"查询成功",users,users.size());
    }

}
